import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[][] arr = new int[n][];
        arr[0] = new int[1];
        arr[0][0] = 1;
        System.out.printf("%5d", arr[0][0]);
        System.out.println();
        for(int i = 1; i < n; i++) {
            arr[i] = new int[i+1];
            arr[i][0] = 1;
            arr[i][i] = 1;
            System.out.printf("%5d", arr[i][0]);
            for(int j = 1; j < i; j++) {
                arr[i][j] = arr[i-1][j-1] + arr[i-1][j];
                System.out.printf("%5d", arr[i][j]);
            }
            System.out.printf("%5d", arr[i][i]);
            System.out.println();
        }
    }
}